<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./js/layui/layui.all.js"></script>
    <script src="/js/common.js"></script>
</head>
<body>
  <button id="btnMain">
      点我
  </button>
</body>
</html>

<script>
    var $ = layui.$;

    $("#btnMain").click(function(){
        $.ajax({
            url:'/api/show',
            method:'post',
            data: $("#form").serialize(),
            success:function(res)
            {
                alert(res);
            }
        });
    });
</script>
